package cheme.ProcessModel;

import java.util.Iterator;
import java.util.List;

/**
 * Adds parent child management features to the child model element.
 * 
 * @author Jonathan
 */
public interface IParent<T extends IChild> extends IChild
{
	/**
	 * 
	 * @return a list of the children of the model element, null if the element is a leaf node.
	 */
	
	List<T> getChildren();
	List getModelChildAndAnnotations();
	
	T get(int index);
	
	int size();
	
	boolean contains(T child);
	int indexOf(T child);
	
	void add(T child);
	void add(T child, int index);
	
	void addAll(List<T> list);
	void addAll(List<T> list, int index);

	void remove(T child);
	void removeAll(List<T> list);
	void replace(T remove, List<T> add);
	
	public void reorderChild(T child, int index);
	
	void set(int index, T value);
	void set(int index, T value, String updateProperty);
	
//	void refreshChildrenPropertyChangeListeners();
	
	Iterator<T> iterator(); 
}
